package menuenum

/*
*
note:
选项值列表值强制从1开始
单选按钮值可以从0开始
*/
type menuType int

const (
	CateGory menuType = 10
	Menu     menuType = 20
	Node     menuType = 30
	Link     menuType = 40
	Enable   menuType = 0
	Disable  menuType = 1
	RootMenu menuType = 0
)

func NewType(code int) menuType {
	return menuType(code)

}
func NewStatus(code int) menuType {
	return menuType(code)

}

var ListTypeMap = map[menuType]string{
	CateGory: "目录",
	Menu:     "菜单",
	Node:     "按钮",
	//Link:     "超链接",
}
var ListStatusMap = map[menuType]string{
	Enable:  "启用",
	Disable: "禁用",
}

func (p menuType) StringMenuType() string {
	if v, ok := ListTypeMap[p]; ok {
		return v
	}
	return "空"
}
func (p menuType) StringMenuStatus() string {
	if v, ok := ListStatusMap[p]; ok {
		return v
	}
	return "空"
}
